#include "InitialConditions.h"

InitialConditions::InitialConditions()
{
	pX0 = 0.0;
	dt = 0.0;  pV0 = 0.0; pRho = 0.0; pDia = 0.0; velG = 0.0; muG = 0.0; rhoG = 0.0;
	nSteps = 1;
}
InitialConditions::InitialConditions(string fileName)
{
	//string inputFileName = "inputData.txt";
	string inputFileDirect = GetInputDirectory(fileName);
	ifstream inputFile(inputFileDirect);
	
	pX0 = 0.0;
	
	assert(inputFile.is_open());

	string tempString;
	inputFile >> tempString >> dt;
	inputFile >> tempString >> pV0;
	//inputFile >> tempString >> Cd;
	inputFile >> tempString >> pRho;
	inputFile >> tempString >> pDia;
	inputFile >> tempString >> velG;
	inputFile >> tempString >> muG;
	inputFile >> tempString >> rhoG;
	inputFile >> tempString >> nSteps;
	inputFile.close();
}
string InitialConditions::GetInputDirectory(string inputFileName)
{
	char homeDirect[1024];
	_getcwd(homeDirect, 1024);
	string localDirect = (string)(homeDirect)+(string)("\\LocalSettings\\") + inputFileName;
	return localDirect;
}